<link rel="stylesheet" href="../css/datalist.css" type="text/css">
<body>
<?php require("topbut.php") ?>
<div class="panel panel-inverse">
    <div class="panel-heading">
        <p class="panel-title">产品中心</p>
    </div>
    <div class="panel-body">
        <style type="text/css">
          .logopic{text-align: center;}
          .logopic img{max-width:95%;vertical-align: middle;max-height:95%;}
          .logb{border:1px solid #ddd;text-align: center;margin-bottom: 20px;}
          @media screen and (max-width:720px) {
            .logopic .col-md-4 div{}
            .logopic .col-md-4 div img{vertical-align: middle;max-width:99%;max-height: 95%;}
            .logb{height: 210px;}
          }
        </style>
        <div class="row">
                <?php
                $pagecount=12;
                $condition=" where categoryid=2 ";
                $psql="select count(0) from ld_product $condition";
                $db->query($psql,3);
                $pcount=$db->fval;
                $pagecount=$pagecount;   //每页条数
                $astr="&lsact=productlist"; //Url
                $pagearr=pagelist($pagecount,$pcount,$astr);
                $offset=$pagearr[1];
                $db->query("select * from ld_product $condition order by id asc limit $offset,$pagecount");
                $list=$db->rs;
                foreach ($list as $key => $rs) {
            ?>
          <div class="col-md-3">
            <div style="border:1px solid #ddd;text-align: center;margin-bottom: 20px;height:326px;">
              <?php if(!empty($rs["proimg"])){?><!-- <a href="../proimgs/<? echo $rs["proimg"]?>" target="_blank" > --><a href="home.php?lsact=porder&id=<? echo $rs["id"]?>">
                <img src="<? echo htmlspecialchars(strip_tags($rs["proimg"]))?>" border="0" height="200px" style="margin:15px 0;max-width:95%;"/></a><?php }else echo "无";?>
              <div class="caption" style="background:#f8f8f8;border-top: 1px solid #ddd;height: 94px;">
                <a href="home.php?lsact=porder&id=<? echo $rs["id"]?>"><h3 style="height: 45px;text-align: left;padding:0 15px;"><? echo $rs["productname"]?></h3></a>
                <p style="text-align: left;padding:0 15px 10px 15px;color: #676a6c;font-size: 12px;">库存：<b><? echo $rs["num"]?></b>&nbsp;&nbsp;&nbsp;&nbsp;会员价格：<b><? echo $rs["price"]?> </b></p>
                <!-- <p><a href="home.php?lsact=porder&id=<? echo $rs["id"]?>">定购</a></p> -->
              </div>
            </div>
          </div>
                  <?php
          }

          ?>
        </div>
        <?php if(($pcount/$pagecount)>1){?>
        <div class="pagediv"><?php echo $pagearr[0]?></div>
        <?php }?>
         <?php if($pcount==0){?>
         <div class="pagediv" style="text-align:center;color:#E47501">--> 暂无数据</div>

         <?php

         }
         ?>
      </div>

</div>
